.m-switch {
  position: relative;
  display: inline-block;
  width: 96rpx;
  height: 48rpx;
  background-color: #fff;
  border: 2rpx solid rgba(0, 0, 0, 0.1);
  border-radius: 60rpx;
  transition: background-color 0.3s;
  box-sizing: content-box;
  vertical-align: middle;

  &.m-switch--on {
    background-color: var(--color-primary, #409EFF);

    .m-switch__node {
      transform: translateX(48rpx);
    }
  }

  &.m-switch--disabled {
    opacity: 0.7;
  }

  .m-switch__input {
    display: none;
    opacity: 0;
  }

  .m-switch__node {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    z-index: 1;
    width: 48rpx;
    height: 48rpx;
    background-color: #fff;
    box-shadow: 0 3rpx 1px 0 rgba(0, 0, 0, 0.05),
      0 4rpx 4rpx 0 rgba(0, 0, 0, 0.1),
      0 6rpx 6rpx 0 rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.3, 1.05, 0.4, 1.05);

    .m-spinner__snake {
      display: inline-block;
      width: 30rpx;
      height: 30rpx;
      border-radius: 50%;
      border: 4rpx solid;
      border-top-color: transparent;
      vertical-align: middle;
      background: transparent;
      animation: loading-snake 0.8s linear infinite;
    }

    @keyframes loading-snake {
      0% {
        transform: rotate(0);
      }

      100% {
        transform: rotate(360deg);
      }
    }
  }
}